import type { LocaleSetting } from '@/locales/types';
import { LOCALE } from '@/locales/types';

function getLocaleSetting(): LocaleSetting {
  const locale = navigator.language === LOCALE.ZH_CN ? LOCALE.ZH_CN : LOCALE.EN_US;
  return {
    // Locale
    locale,
    // Default locale
    fallback: locale,
    // available Locales
    availableLocales: [LOCALE.ZH_CN, LOCALE.EN_US]
  };
}

export const localeSetting = getLocaleSetting();
